class roomListBtn extends how.Button {
    public bg: eui.Image;
    public title: eui.Image;
    public moneyTip: eui.Label;//准入
    public constructor() {
        super();
        this.skinName = "roomListBtnSkin";
    }
}

window["roomListBtn"] || (window["roomListBtn"] = roomListBtn);

class roomListItem extends how.module.ItemView {
    private btnEnter: roomListBtn;
    public constructor() {
        super();
        this.skinName = "roomListItemSkin";
    }
    public dataChanged(): void {
        //获取列表类型，接口修改之前的暂时方案
        this.btnEnter.bg.source = "room_pic_" + this.itemIndex + "_png";
        this.btnEnter.title.source = "room_game_itle_" + this.itemIndex + "_png";
        this.btnEnter.moneyTip.text = LanguageConfig.minMaxMoney + base.Utils.formatCurrency(this.data.baseScore);
        this.btnEnter.addEventListener(egret.TouchEvent.TOUCH_TAP, this.goGame, this);

    }
    public goGame() 
    {
        if(this.data.baseScore == 0) //房卡房判断临时标准
        {
            this.report(RoomListWindowModule.request.onRoomItemBtn2, this.data);
        }
        else if (AppData.getInstance().userData.money >= this.data.baseScore) 
        {
            this.report(RoomListWindowModule.request.onRoomItemBtn, this.data);
        }
        else 
        {
            how.Alert.show(LanguageConfig.error_72);
        }
    }
}

window["roomListItem"] || (window["roomListItem"] = roomListItem);